package com.zjf.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zjf.entity.Address;
import com.zjf.mapper.DeliveryAddressMapper;
import com.zjf.service.IDeliveryAddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class DeliveryAddressServiceImpl extends ServiceImpl<DeliveryAddressMapper, Address> implements IDeliveryAddressService {
    @Resource
    private DeliveryAddressMapper deliveryAddressMapper;

    @Override
    public List<Address> listDeliveryAddressByUserId(String userId) {
        return deliveryAddressMapper.listDeliveryAddressByUserId(userId);
    }

    @Override
    public Address getDeliveryAddressById(Integer daId) {
        return deliveryAddressMapper.getDeliveryAddressById(daId);
    }

    @Override
    public int saveDeliveryAddress(Address address) {
        return deliveryAddressMapper.saveDeliveryAddress(address);
    }
    @Override
    public int updateDeliveryAddress(Address address) {
        return deliveryAddressMapper.updateDeliveryAddress(address);
    }

    @Override
    public int removeDeliveryAddress(Integer daId) {
        return deliveryAddressMapper.removeDeliveryAddress(daId);
    }
}
